package prv.pursuivant.config;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * 
 * Interface common for serializing configuration. Can be factory, can be file
 * reader/writer
 * 
 * @author Kwinto
 * @see Config
 * 
 */

public interface ConfigSerializer {

	/**
	 * Reads configuration
	 * 
	 * @param stream
	 *            stream with configuration data
	 * 
	 * @return configuration read
	 * @throws IOException
	 */
	Config readConfig(InputStream stream) throws IOException;

	/**
	 * Writes configuration
	 * 
	 * @param config
	 *            configuration to be written
	 * @throws IOException
	 */
	void writeConfig(Config config, OutputStream stream) throws IOException;

}
